<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="com.jd.ty.pojo">
	<class name="Dictionary" table="DICTIONARY_SUB" schema="tyms" >
		<id name="dictionaryId" type="java.lang.Long">
			<column name="DICTIONARY_ID" precision="10" scale="0" />
			<generator class="native" />
		</id>

		<property name="dictionaryName" type="java.lang.String">
			<column name="DICTIONARY_NAME" length="100" />
		</property>
		<property name="code" type="java.lang.String">
			<column name="CODE" length="500" />
		</property>
		<property name="description" type="java.lang.String">
			<column name="DESCRIPTION"  length="300" />
		</property>
		<property name="level" type="java.lang.Integer">
			<column name="NODE_LEVEL"  length="2" default="0"/>
		</property>
		<many-to-one name="parentDictionary" class="Dictionary" column="PARENT_ID"
			cascade="save-update" />
		<bag name="children" cascade="all" inverse="true" lazy="false">
			<key column="PARENT_ID" />
			<one-to-many class="Dictionary" />
		</bag>
	</class>
</hibernate-mapping>
